<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
   <meta charset="UTF-8">
   <title>$Title$</title>
   <script type="text/javascript" src="https://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.2.min.js"></script>
   <script>
      $(function(){
         $('#btn').click(function(){
            var message = '';
            var username = $('#username').val();
            var password = $('#password').val();
            $.getJSON('user/login',{'username':username,'password':password},function(data){
               console.log(data);
               if(data == 0){
                  window.location.href = 'success.jsp'
               }else{
                  if(data == 1)
                     message = "error"
                  $('#message').html(message)
               }
            })
         })
      })

   </script>

</head>
<body>

<div style="text-align: center">

<h2>登陆界面</h2>
<form >
   <input id="username" name="username"  placeholder="username" ><br>
   <input type="password" id="password" name="password" placeholder="password"><br>
   <input type="submit" value="登录" id="btn" ><br>
</form>
   <div id="message"></div>

</div>
</body>
</html>
